Fix infinite loop in gdkevents.c _gdk_event_queue_find_first
authorHamish Mackenzie <Hamish.K.Mackenzie@googlemail.com>
Sat, 28 Sep 2013 16:06:53 +0000 (05:06 +1300)
committerJohn Ralls <jralls@ceridwen.us>
Fri, 11 Oct 2013 18:06:23 +0000 (11:06 -0700)
gdk/gdkevents.c

index 327b543824a8fa052a5b7cf070e4061208e2ccb3..e770f4777ba35bc9b36004f4f6a921104f6dcea4 100644 (file)
@@ -96,16 +96,16 @@ _gdk_event_queue_find_first (GdkDisplay *display)
     {
       GdkEventPrivate *event = tmp_list->data;
 
-      if (event->flags & GDK_EVENT_PENDING)
-        continue;
-
-      if (pending_motion)
-        return pending_motion;
+      if (!(event->flags & GDK_EVENT_PENDING))
+        {
+          if (pending_motion)
+            return pending_motion;
 
-      if (event->event.type == GDK_MOTION_NOTIFY && !display->flushing_events)
-        pending_motion = tmp_list;
-      else
-        return tmp_list;
+          if (event->event.type == GDK_MOTION_NOTIFY && !display->flushing_events)
+            pending_motion = tmp_list;
+          else
+            return tmp_list;
+        }
 
       tmp_list = g_list_next (tmp_list);
     }